package com.snifferx.services;

import java.util.Collection;

import org.springframework.security.core.GrantedAuthority;

import com.snifferx.domain.AuthorityEntity;

public interface RolePermissionService {

	/**
	 * Get the role info
	 * 
	 * @param userName
	 * @throws Exception 
	 */
	
	//just can be invoke by super administrator 
	AuthorityEntity loadAuthorityEntityByUsername(String userName) throws Exception;
	
	/***return collection which contains all roles from DB
	 * 
	 * @return collection
	 */
	Collection<AuthorityEntity> getAllroles();
	
	/**
	 * 
	 * @param authority
	 * @return
	 */
	//just can be invoke by super administrator
	boolean updateRole(AuthorityEntity authority);
	
	/**
	 * get the roles info from user and role
	 * 
	 */
	Collection<Object> getAllrolesJoinView();
}
